//常用规则
import {minAmount} from "./validators"



export const  rules =  {
  account:[
    { required: true, message: '请输入账号', trigger: 'blur' },
    { min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur' },
  ],
  leader: [
    { required: true, message: '请输入姓名', trigger: 'blur' },
    { min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur' },
    {
      required: true,
      pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/,
      message: '姓名不支持特殊字符',
      trigger: 'blur'
    }
  ],

  seller: [
    { required: true, message: '请输入姓名', trigger: 'blur' },
    { min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur' },
    {
      required: true,
      pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/,
      message: '姓名不支持特殊字符',
      trigger: 'blur'
    }
  ],

  customer: [
    { required: true, message: '请输入姓名', trigger: 'blur' },
    { min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur' },
    {
      required: true,
      pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/,
      message: '姓名不支持特殊字符',
      trigger: 'blur'
    }
  ],

  idcard: [
    { required: true, message: '请输入身份证号', trigger: 'blur' },
    { min: 15, max: 18, message: '请如实填写18位号码，以供学校保卫科核对', trigger: 'blur' },
    {
      required: true,
      pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
      message: '请输入正确的身份证号码',
      trigger: 'blur'
    }
  ],

  leader_mobile:[
    { required: true, message: '请输入手机号', trigger: 'blur' },
    {type:'string',max:11,min:11,message:'请输入11位手机号', trigger: 'blur' },
    {
      required: true,
      pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
      message: '请输入正确的手机号码',
      trigger: 'blur'
    }
  ],

  seller_mobile:[
    { required: true, message: '请输入手机号', trigger: 'blur' },
    {type:'string',max:11,min:11,message:'请输入11位手机号', trigger: 'blur' },
    {
      required: true,
      pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
      message: '请输入正确的手机号码',
      trigger: 'blur'
    }
  ],

  customer_mobile:[
    { required: true, message: '请输入手机号', trigger: 'blur' },
    {type:'string',max:11,min:11,message:'请输入11位手机号', trigger: 'blur' },
    {
      required: true,
      pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
      message: '请输入正确的手机号码',
      trigger: 'blur'
    }
  ],


  start: [{ type: 'string', required: true, message: '请选择日期', trigger: 'change' }],
  stop: [{ type: 'string', required: true, message: '请选择日期', trigger: 'change' }],
  create_at: [{ type: 'string', required: true, message: '请选择日期', trigger: 'change' }],
  created_at: [{ type: 'string', required: true, message: '请选择日期', trigger: 'change' }],
  email: [
    { type: 'email', required: true, message: '请输入邮箱', trigger: 'blur' }
  ],
  sex:[{type:'number',required: true,message:'请输入性别', trigger: 'blur' },],

  gsid:[{type:'number',required: true,message:'请选择公司', trigger: 'change' },],

  deptid:[{type:'number',required: true,message:'请选择单位', trigger: 'change' },],

  name:[{ required: true, message: '请输入项目名称', trigger: 'blur' },],

  offer:[
    {type:'string',required: true,message:'请输入报价金额', trigger: 'blur' },
    minAmount(1,"元")
  ],

  cost:[
    {type:'string',required: true,message:'请输入成本金额', trigger: 'blur' },
    minAmount(1,"元")
  ],

  city:[{type:'string',required: true,message:'请输入城市', trigger: 'blur' },],

  desc:[{type:'string',required: true,message:'请输入备注信息', trigger: 'blur' },],

  currency:[{type:'string',required: true,message:'请输入币种', trigger: 'blur' },],

  work_id:[{type:'number',required: true,message:'请选择流程', trigger: 'blur' },],
};
